package com.yj.service;

import com.yj.entity.ChatContent;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
@Slf4j
public class ChatContentMessageHandlerProcess implements MessageHandlerProcess {

    @Autowired
    private ChatService qytwChatService;

    @Override
    public boolean support(Object message) {
        return ChatContent.class.isAssignableFrom(message.getClass());
    }

    @Override
    public ChatContent process(Object message) {
        ChatContent chatContent = (ChatContent) message;
        return qytwChatService.chat((ChatContent) message);
    }
}
